#ifndef db_H
#define db_H

#include <mysql.h>

#include "db_info.h"
#include "db_op.h"

class Database {
protected:
    MYSQL* conn;
public:
    Database() : conn(nullptr) {};

    virtual ~Database() {};
    virtual bool connect(DatabaseInfo* db_info) = 0;
    virtual void accept(Database_Operater* db_op, const char* op) = 0;
};

// 数据库对象
class Library_Database : public Database{
public:
    Library_Database();

    ~Library_Database();

    bool connect(DatabaseInfo* db_info) override;

    void accept(Database_Operater* db_op, const char* op) override;
};


#endif